﻿@model FloodFree.Common.Sensor


@{
    ViewBag.Title = @Resources.Resource.AdminAddSensorTitle;
    Layout = "~/Areas/Admin/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>@Resources.Resource.AdminMenuSensors</h2>
@{
    Html.RenderPartial("_ValidationSummary", ViewData.ModelState);
}


@using (Html.BeginForm())
{
   
    <fieldset>
        <div class="editor-label">
            @Html.LabelFor(model => model.SensorUUID)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(x => x.SensorUUID)
            @Html.ValidationMessageFor(model => model.SensorUUID)
        </div>

        <div class="editor-label">
            @Html.Label(@Resources.Resource.City)
            
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.City.Id,
                    new SelectList(ViewBag.Cities, "Id", "Name"))
            @Html.ValidationMessageFor(model => model.City.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Address)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(x => x.Address)
            @Html.ValidationMessageFor(model => model.Address)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Latitude)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(x => x.Latitude)
            @Html.ValidationMessageFor(model => model.Latitude)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Longitude)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(x => x.Longitude)
            @Html.ValidationMessageFor(model => model.Longitude)
        </div>

        <p>
            <input type="submit" value="@Resources.Resource.SaveButton" class="btn btn-primary" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink(@Resources.Resource.BackToList, "Index")
</div>

